An important function provided by computer systems is the ability to interact with internal and external components. This functionality, generally categorized as input/output (I/O) operations, is facilitated by hardware architecture, such as buses and device interfaces, in combination with software and firmware components that execute on the computer system's processor(s). Exemplary I/O devices include input devices, such as mice and keyboards, and peripheral devices, such as disk drives, CD-ROM drives, DVD drives, network interfaces, audio devices, and video displays.
One area of concern for early hardware engineers and software designers was the lack of consistency between hardware device interfaces. The software designers desired an interface standard that would simplify designing device drivers, while the hardware engineers desired a flexible platform interface. In the early 1990's, the Intel® Corporation led an industry effort to develop a peripheral device interface standard that was designed to address both of these problems. The standard interface is known as the Peripheral Component Interconnect (PCI) architecture.
FIG. 1 shows a portion of a typical PCI bus configuration 10 illustrative of the PCI architecture. PCI Bus configuration 10 includes a host bus 12 to which a host CPU 14, host memory 16, and cache 18 are connected. In general, for a given system, host CPU 14 will be the primary bus master for the system, and will be used to service interrupts and handle system errors. As illustrated in FIG. 1, the various buses in a system comprise a hierarchy that includes one or more levels, wherein buses at a lower level are subordinate to buses at a higher level. The first subordinate bus level below the host bus is the root bus, which is labeled PCI Bus 0 in PCI bus configuration 10. Additional levels depicted in FIG. 1 include a level 1, a level 2, and a level 3.
Buses between levels are enabled to communicate with one another through the use of “bridges.” The primary purpose of a “bridge” is to interface one bus protocol to another. The protocol includes the definition of the bus control signal lines, and data and address sizes. For example, a host/PCI bridge 0 is used to enable communication between host bus 12 and PCI bus 0. Under conventional terminology, a bridge is labeled to correspond to its subordinate bus, i.e., a bridge “n” will correspond to a PCI Bus “n” or other type of Bus “n.” When a bridge interfaces similar bus types, the bridge primarily limits the loading on each bus. Instances of these types of bridges are illustrated by the various PCI/PCI bridges in FIG. 1. PCI Bus configuration 10 also includes several PCI peripheral devices, including a modem 20, a sound card 22, and a network card 24. For clarity, many of the buses shown in bus configuration 10 are depicted as not being connected to any devices; it will be recognized that each of the buses may support one or more devices.
In order to interface with ISA (industry standard architecture) peripherals and other legacy components, a legacy bus 26 is provided, which communicates with PCI bus 0 via a PCI/legacy bridge 28. Under another common configuration, a legacy bus may be connected directly to a host bus using an appropriate host bus/legacy bus bridge. The legacy bus enables the system to use various legacy devices and peripherals, such as ISA cards, legacy disk controllers, keyboards, mice, and video cards, as depicted in a legacy device block 30. Under many systems, the legacy bus must be enabled prior to other buses to successfully boot the systems.
In addition to the single root-bus hierarchy of FIG. 1, a PCI bus configuration may employ multiple root buses. For example, FIG. 2 illustrates an exemplary multiple root bus configuration 32 that includes three root busses, respectively labeled root bus 0, root bus 1, and root bus 2. Each root bus includes several layers of subordinate busses connected by corresponding bridges, which are identified by the blocks labeled “BR#” in FIG. 2. In addition, various devices, depicted as blocks containing a “D,” are also included in configuration 32, as well as legacy devices 30 and a PCI-to-Legacy bridge 28.
PCI defines three address spaces: PCI I/O, PCI memory, and PCI configuration space. The PCI I/O space is used to store driver code via which corresponding hardware devices are accessed, while the PCI memory space is used to map memory resources used by a PCI device (such as a video card). From the architecture standpoint, each PCI bridge is considered an additional PCI device for which memory resources must also be allocated.
Like all memory, the PCI I/O and PCI memory spaces are finite, and oftentimes scarce. Under conventional practice, the BIOS code for Intel® systems (and the PCI Fixup code for non-Intel® systems) is employed to allocate each hardware device an amount of memory requested by that device. Additionally, both PCI I/O and PCI Memory must be allocated to a device in a naturally-aligned way. For example, if a device asks for 0xB0 of PCI I/O space then it must be aligned on an address that is a multiple of 0xB0. Furthermore, the PCI I/O and PCI Memory buses for any given bridge must be aligned on 4K and on 1 Mbyte boundaries, respectively. In addition, the address spaces for downstream devices must lie within all of the upstream PCI-PCI Bridge's memory ranges for any given device. These requirements make efficient allocation of address space for I/O devices difficult.